/**
 * 
 */
package com.p2p.front.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;
import com.p2p.base.page.PageVo;
import com.p2p.front.dal.model.LoanInfo;
import com.p2p.front.web.form.LoanForm;

/**
 * @author ruiqi
 *
 */
public interface LoanInfoService {

	LoanInfo getLoanInfoById(Long lid);

	boolean updateStatus(Long lid, int status);
	
	boolean updateStatus(Long lid, int status, int oldStatus);

	PageVo list(PageVo form);
	
	public PageInfo listPageByStatus(LoanForm form);

	void saveLoanInfo(LoanInfo loanInfo);

	List<LoanInfo> list(Integer count);

	List<Map<String, Object>> batchList(List list);

	Map<Long,LoanInfo> findByIdList(List<Long> lidList);
	void updateLoanInfo(LoanInfo loanInfo);
	
	List<LoanInfo> findByStatus(List<Integer> statusList);
	
	public boolean updateAuto(Long loanId,Integer auto,Integer oldAuto);
	
	public boolean updateBeginEndTime(Long loanId,Date begintime,Date endtime);

	@Deprecated
	Map<String, Object> get(Long lid);
	
	Long getDayAmount(Date dateBegin, Date dateEnd);

	void updateDesc(Long lid, String description);
	
	List<LoanInfo> getLastSucceededLoan();

	List<Map<String, Object>> batchWaitList();
	
	/**
	 * 查询置顶（移动端首页显示）借款
	 * @return
	 */
	LoanInfo findTopLoan();
}
